import { RouteRecordRaw } from 'vue-router'
import Layout from '@/layout/index.vue'
import { Notebook } from '@element-plus/icons-vue'

const routes: RouteRecordRaw[] = [
    
    {
        path:'/he',
        component: Layout,
        children: [
          {
            path: '/he',
            components:{
              default:()=>import('../views/he/index.vue')
            }
          }
        ],
        meta: {inMenu: false}
    },
    {
        path:'/pei',
        component: Layout,
        children: [
          {
            path: '/pei',
            components:{
              default:()=>import('../views/pei/index.vue')
            }
          }
        ],
        meta: {inMenu: false}
    },
    {
        path:'/pe',
        component: Layout,
        children: [
          {
            path: '/pe',
            components:{
              default:()=>import('../views/pe/index.vue')
            }
          }
        ],
        meta: {inMenu: false}
    },

  {
      path:'/login',
      component: ()=>import('../views/login/login.vue'),
      meta:{
          title:'用户登录',
          inMenu: false
      }
  },
  {
    path:'/home',
    component: Layout,
    children: [
        {   path: '/home',
            component: ()=>import('../views/home/home.vue'),
            meta:{title:'工作台'}
        }
    ],
    meta:{
        needPermission:true
    }
  },
  {
    path:'/message',
    component: Layout,
    children: [
        {   path: '/message',
            component: ()=>import('../views/message/message.vue'),
            meta:{title:'消息管理'}
        }
    ],
    meta:{
        needPermission:true
    }
  },
  {
    path: '/contract',
    component: Layout,
    children: [
      {
        path: 'index',
        component: () => import('../views/contract/pending/index.vue'),
        meta: { title: '待处理签约' }
      },
      {
        path: 'reindex',
        component: () => import('../views/contract/record/reIndex.vue'),
        meta: { title: '签约记录' }
      },
    ],
    meta: {
      title: '签约管理'
    }
  },
  {
    path: '',
    component: Layout,
    meta: { inMenu: false }
  },
  
  {
    path: '/service',
    component: Layout,
    children: [
      {
        path: 'pending',
        component: () => import('../views/service/pending.vue'),
        meta: { title: '待处理服务' }
      },
      {
        path: 'record',
        component: () => import('../views/service/record.vue'),
        meta: { title: '服务记录' }
      },
    ],
    meta: { title: '服务管理', icon: Notebook }
  },
  {
    path: '/ha',
    component: Layout,
    children: [
      {
        path: '/ha',
        component: () => import('../views/ha/index.vue'),
        meta: { title: '居民管理'}
      },
    ],
    meta:{
      needPermission:true
  }
  },
  {
    path:'/usermessage',
    component:Layout,
    children: [
      {
        path:'/usermessage',
        component:()=>import('../views/usermessage/usermessage.vue'),
        meta: {
            needPermission:true
        }
      },
    ],
    meta: {
      inMenu: false,
  }
  },
  {
      path:'/reset',
      component:Layout,
      children: [
          {
              path:'/reset',
              component:()=>import('../views/reset/reset.vue')
          }
      ],
      meta: {
          inMenu: false,
          needPermission:true
      }
  },
    
  {
    path: '/new-service',
    component: Layout,
    children: [
      {
        path: '/new-service',
        component: () => import('../views/service/new-service.vue')
      }
    ],
    meta: {inMenu: false}
  },
  {
    path: '/service-detil',
    component: Layout,
    children: [
      {
        path: '/service-detail',
        component: () => import('../views/service/service-detail.vue')
      }
    ],
    meta: {inMenu: false}
  },
  {
    path: '/recontract',
    component: Layout,
    children: [
      {
        path: 'edit',
        component: () => import('../views/contract/pending/edit.vue'),
        meta: {
          title: '编辑签约信息',
        }
      },
      {
        path: 'detail',
        component: () => import('../views/contract/pending/detail.vue'),
        meta: {
          title: '签约详情',
        }
      },
      {
        path: 'redetail',
        component: () => import('../views/contract/record/reDetail.vue'),
        meta: {
          title: '签约详情',
        }
      },
      {
        path: 'reedit',
        component: () => import('../views/contract/record/reEdit.vue'),
        meta: {
          title: '编辑签约信息',
        }
      },
    ],
    meta: {
      inMenu: false
    }

  }
  
]

export default routes